﻿@page
@using SXFramWork.Web
@{
    ViewData["Title"] = "任务日志";
    Layout = "~/Pages/Admin/_Layout.cshtml";
}
<div id="container">


    <div class="list-wall">
        <table class="layui-hide" id="tablelist" lay-filter="tool"></table>
    </div>


    <script>
            layui.use([ 'jquery', 'common'],
                function () {
                        $ = layui.jquery,
                        os = layui.common

                    //var id = os.getUrlParam('id');

                    //加载表格数据
                    os.tableRender({
                        elem: '#tablelist',
                        url: "/api/admin/sysjob/log",
                        where: { id: os.getUrlParam('id')},
                        cols: [
                            [
                                {
                                    title: '类型', templet: function (a) {
                                        if (a.type == 0) return '<span class="layui-badge layui-bg-orange">信息</span>';
                                        else if (a.type == 1) return '<span class="layui-badge layui-bg-orange">运行中</span>';
                                        else return '<span class="layui-badge">异常</span>'
                                    }
                                },
                                { field: 'message', title: '信息' },
                                { field: 'createTime', title: '创建时间' }
                            ]
                        ]
                    })

                    var active = {

                        reload: function () {
                            os.tableReload('tablelist',
                                { where: {} }
                            )
                        },

          
                    };

                    $('.list-search .layui-btn').on('click', function () {
                        var type = $(this).data('type');
                        active[type] ? active[type].call(this) : '';
                    });
                   
                });
    </script>

</div>